home *** CD-ROM | disk | FTP | other *** search
/ HyperLib 1997 Winter - Disc 1 / HYPERLIB-1997-Winter-CD1.ISO.7z / HYPERLIB-1997-Winter-CD1.ISO / オンラインウェア / PRG / WASTE Object Handlers 1.2.2.sit / WASTE Object Handlers 1.2.2 / Other Source / WASTE_Objects.c < prev    next >
Text File  |  1996-07-16  |  3KB  |  109 lines

  1. // WASTE Object Archive intialization code
  2. // by Michael F. Kamprath, kamprath@kagi.com
  3. // maintenance by John C. Daub, hsoi@eden.com
  4. //
  5. // v1.0.1, 6 April 1995
  6. //
  7. // History
  8. //
  9. //        v1.0.1: Updated the handler installer calls to be compatible with v1.1a6
  10. //                of WASTE (CWATE v1.1r10 or later).
  11. //        v1.0.2: Updated the handler installer calls to be compatible with v1.1a8
  12. //                of WASTE (CWASTE v1.1r12 or later).  Basically, they now use UPPs.
  13. //                Code update actually done by Dan Crevier.
  14. //        v1.1:    Changed code to use individual object installers.
  15. //
  16. //        v1.2:    Updated calls to be compatabile with WASTE v1.2a5.
  17. //                - Added precompiler directives
  18. //                - InstallAllWASTEObjectHandlers() now takes a WEReference as an argument
  19. //                - Added Init/ExitWASTEObjectHandlers() to perform any startup/shutdown tasks
  20. //                  from within the library
  21. //                - Added DoObjectTasks() to facilitate handling of periodic object tasks
  22. //                - Added WEObjectPaste()
  23.  
  24. #ifndef __DRAG__
  25. #include <Drag.h>
  26. #endif
  27.  
  28. #ifndef _WASTE_
  29. #include "WASTE.h"
  30. #endif
  31.  
  32. #include "WE_hfs_Handler.h"
  33. #include "WE_PICT_Handler.h"
  34. #include "WE_snd_Handler.h"
  35.  
  36. #ifndef _WASTEOBJECTS_
  37. #include "WASTE_Objects.h"
  38. #endif
  39.  
  40. //
  41. //    Installs ALL the object handlers in the given WASTE instance
  42. //  (or install all object handlers globally if passed nil)
  43. //
  44. OSErr   InstallAllWASTEObjHandlers( WEReference theWE )
  45. {
  46. OSErr   iErr;
  47.  
  48.     iErr = InstallPICTObject( theWE );
  49.     if (iErr) return(iErr);
  50.  
  51.     iErr = InstallSoundObject( theWE );
  52.     if (iErr) return(iErr);
  53.     
  54.     iErr = InstallHFSObject( theWE );
  55.     if (iErr) return(iErr);
  56.         
  57.     return(noErr);
  58. }
  59.  
  60. //
  61. //    InitWASTEObjectHandlers()
  62. //        Handles internal initializations (if any)
  63.  
  64. void    InitWASTEObjectHandlers( void )
  65. {
  66.     InitSoundObjectHandler();
  67. }
  68.  
  69. //
  70. //    ExitWASTEObjectHandlers()
  71. //        Handlers internal exit/clean-up (if any)
  72.  
  73. void    ExitWASTEObjectHandlers( void )
  74. {
  75.     // nothing now...here for future expansion
  76. }
  77.  
  78.  
  79. //
  80. //    DoObjectTasks()
  81. //        MUST be called periodically by your application (ideally in the main event loop)
  82. //        to handle object-related tasks
  83.  
  84. OSErr    DoObjectTasks( WEReference theWE )
  85. {
  86. #pragma unused (theWE)
  87.  
  88.     CheckSoundStatus();
  89.     
  90.     return noErr;
  91. }
  92.  
  93.  
  94. //
  95. //    WEObjectsPaste()
  96. //        Used in place of WEPaste to allow for handling of special object types
  97. //        (falls through to WEPaste then if needed)
  98.  
  99. pascal OSErr    WEObjectsPaste( WEReference hWE )
  100. {
  101. //    long        scrapOffset;
  102. //    OSErr        iErr;
  103.     
  104.     // check for object types that need special handling
  105.     
  106.     // (none currently)
  107.     
  108.     return WEPaste( hWE );
  109. }